﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMTP.Master" AutoEventWireup="true" CodeBehind="EventsManager.aspx.cs" Inherits="SQT.tracnghiem.Admin.EventsManager" %>

<%@ Import Namespace="DataAccess" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../Content/css/game_plan.css" rel="stylesheet" />
    <script src="../Ajax/JS/Events_Manager.js"></script>
    <script src="../Ajax/JS/EffectFly.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%var get_events = from p in new TblEventController().FetchAll() orderby p.Id descending select p; %>
    <div class="w3-padding">
        <div id="event_area" class="w3-white">
            <div id="dhbc" class="game-content w3-row">
                <div class="game-left w3-third w3-border-right w3-border-teal">
                    <header class="w3-center w3-padding-4">
                        <label>Danh sách sự kiện</label>
                    </header>
                    <div class="w3-padding">
                        <ul id="game-question-list" class="game-question-list w3-ul w3-light-grey">
                            <%foreach (TblEvent events in get_events)
                                { %>
                            <li onclick="event_edit(<%=events.Id %>)"><%=events.Name %></li>
                            <%} %>
                        </ul>
                    </div>
                    <div class="w3-padding-4 w3-center">
                        <a onclick="event_add()" class="game-add-question-btn w3-btn w3-teal">Thêm sự kiện</a>
                    </div>
                </div>
                <div class="game-right w3-twothird">
                    <div id="event-add-form" style="display:none">
                    </div>
                    <div id="event-edit-form" class="game-edit-question-form">
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div id="game-setup-modal" class="w3-modal">
        <div class="game-setup-modal w3-modal-content w3-animate-top w3-card-8 w3-display-container">
            <i onclick="$('#game-setup-modal').fadeOut()" class="fa fa-times-circle w3-closebtn w3-text-white w3-display-topright w3-padding" title="Đóng"></i>
            <header class="w3-center w3-padding w3-large w3-teal">Thiết lập trò chơi</header>
            <div class="w3-row w3-padding">
                <label class="w3-col l3">Tên trò chơi</label><input type="text" class="game-text w3-col l9 w3-light-grey" />
            </div>
            <div class="w3-row w3-padding">
                <label class="w3-col l3">Thời gian / câu</label><input type="number" min="0" class="game-text w3-col l8 w3-light-grey" /><span class="w3-col l1 w3-center">Giây</span>
            </div>
            <div class="w3-row w3-padding">
                <label class="w3-col l3">Điểm số</label><div class="w3-col l9">
                    <div class="w3-row w3-padding-bottom"><span class="w3-col l2">Hạng 1</span><input type="number" min="0" class="game-text w3-col l8 w3-light-grey" /><span class="w3-col l2 w3-center">Điểm</span></div>
                    <div class="w3-row w3-padding-bottom"><span class="w3-col l2">Hạng 2</span><input type="number" min="0" class="game-text w3-col l8 w3-light-grey" /><span class="w3-col l2 w3-center">Điểm</span></div>
                    <div class="w3-row w3-padding-bottom"><span class="w3-col l2">Hạng 3</span><input type="number" min="0" class="game-text w3-col l8 w3-light-grey" /><span class="w3-col l2 w3-center">Điểm</span></div>
                    <div class="w3-row"><span class="w3-col l2">Hạng 4</span><input type="number" min="0" class="game-text w3-col l8 w3-light-grey" /><span class="w3-col l2 w3-center">Điểm</span></div>
                </div>
            </div>
            <div class="w3-row w3-padding w3-center">
                <a class="w3-btn w3-teal"><i class="fa fa-save"></i>&nbsp;Lưu</a>
                <a onclick="$('#game-setup-modal').fadeOut()" class="w3-btn w3-teal"><i class="fa fa-times"></i>&nbsp;Huỷ</a>
            </div>
        </div>
    </div>
    <div id="add_game_modal" class="w3-modal">
        
    </div>
    <div id="add_player_modal" class="w3-modal">
        
    </div>
    <div id="event-delete-question-modal" class="w3-modal">
        <div class="w3-hide" id="delete_id"></div>
        <div class="game-delete-question-modal w3-modal-content w3-animate-top w3-card-8 w3-deep-orange">
            <div class="w3-padding-8 w3-center w3-large">Bạn có chắc chắn muốn xoá sự kiện này ?</div>
            <div class="w3-center w3-padding-8">
                <a onclick="btn_accept_delete()" class="w3-btn w3-deep-orange w3-border w3-border-white w3-hover-white w3-hover-text-deep-orange">Có</a>
                <a onclick="$('#event-delete-question-modal').fadeOut()" class="w3-btn w3-deep-orange w3-border w3-border-white w3-hover-white w3-hover-text-deep-orange">Không</a>
            </div>
        </div>
    </div>
    <div id="event_change_name_player_modal" class="w3-modal">
        <div class="w3-hide" id="change_player_name_id"></div>
        <div class="game-delete-question-modal w3-modal-content w3-animate-top w3-card-8 w3-teal">
            <div class="w3-padding-8 w3-center w3-large w3-row">
                <label class="w3-col l4">Tên đội</label> <input id="change_player_name" placeholder="Nhập tên đội" class="w3-col l7 class-editor" />
            </div>
            <div class="w3-center w3-padding-8">
                <a onclick="btn_accept_change_name()" class="w3-btn w3-deep-orange w3-border w3-border-white w3-hover-white w3-hover-text-deep-orange">Có</a>
                <a onclick="$('#event_change_name_player_modal').fadeOut()" class="w3-btn w3-deep-orange w3-border w3-border-white w3-hover-white w3-hover-text-deep-orange">Không</a>
            </div>
        </div>
    </div>
    <div id="success-modal" class="w3-row w3-animate-right" style="position: fixed; right: 25px; bottom: 20%; display: none; z-index: 10">
        <div class="w3-teal w3-card-4 w3-center" style="padding: 20px; opacity: 0.9">
            <header class="w3-large"><i class="fa fa-check"></i>&nbsp;<span id="success_content"></span></header>
        </div>
    </div>
    <div id="error-modal" class="w3-row w3-animate-right" style="position: fixed; right: 25px; bottom: 20%; display: none; z-index: 10">
        <div class="w3-red w3-card-4 w3-center" style="padding: 20px; opacity: 0.9">
            <header class="w3-large"><i class="fa fa-times"></i>&nbsp;<span id="error_content"></span></header>
        </div>
    </div>
    <script src="../Ajax/JS/jquery-ui.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#sortable_add_game").sortable();
            $("#sortable_add_game").disableSelection();
        });
    </script>
</asp:Content>
